import { VendorVo } from '@/api/vendor/types';
import { VxeGridProps } from 'vxe-table';

export function getTableConfig(): VxeGridProps<VendorVo> {
  return {
    id: 'tenant',
    loading: false,
    height: 'auto',
    autoResize: true,
    border: 'inner',
    resizable: true,
    showOverflow: 'tooltip',
    stripe: true,
    rowConfig: {
      isHover: true,
      keyField: 'id'
      // height: 56
    },
    customConfig: {
      storage: true
    },
    columns: [
      { title: '序号', type: 'seq', width: 50 },
      { sortable: true, field: 'vendorId', title: '酒店ID', minWidth: 180 },
      { sortable: true, field: 'name', title: '酒店名称', minWidth: 100 },
      { sortable: false, field: 'regionName', minWidth: 100, title: '区域' },
      { sortable: true, field: 'roomQuantity', minWidth: 90, title: '房间总数' },
      { sortable: true, field: 'devRoomQuantity', minWidth: 90, title: '建设房间数' },
      { sortable: true, field: 'deviceNum', minWidth: 80, title: '终端数' },
      { sortable: true, field: 'launchTime', minWidth: 120, title: '上首次商用时间' },
      { sortable: true, field: 'constructionType', title: '建设类型', minWidth: 80, slots: { default: 'type' } },
      { sortable: true, field: 'selfPercent', minWidth: 90, title: '投资比例', formatter: ({ row }) => row.selfPercent + '%' },
      { sortable: true, field: 'constructionCost', minWidth: 100, title: '总投资' },
      { sortable: true, field: 'investmentProgress', minWidth: 90, title: '回本进度', formatter: ({ row }) => row.selfPercent + '%' },
      { sortable: true, field: 'lastMaintenanceTime', minWidth: 120, title: '上传维保时间' },
      { sortable: true, field: 'contactPerson', minWidth: 80, title: '联系人' },
      { sortable: true, field: 'phone', minWidth: 100, title: '联系电话' },
      // { sortable: true, field: 'operationalMode', minWidth: 100, title: '调试模式', slots: { default: 'mode' } },
      /*{ sortable: true, field: 'type', title: '结算账户类型', minWidth: 80, slots: { default: 'type' } },*/
      { sortable: false, field: 'handle', fixed: 'right', title: '操作', width: '280px', slots: { default: 'handle' } }
    ],
    data: [] as VendorVo[]
  };
}
